﻿using STHPMS1.ICore.I_Entity.Info;
using STHPMS1.ICore.I_Entity.Stmpms1;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Data;

namespace STHPMS1.ICore.I_BLL.Bus
{
    public interface IB_UnitBill : IBll
    {
        List<string> GetUnits(string segId);
        void Save<T>(T entity) 
            where T:class ,IB_Unit;

        void Remove(IB_Unit entity);

        IEnumerable<T> Get<T>(Expression<Func<T, bool>> predicate, IPagingInfo info)
            where T : class, IB_Unit;


        double GetLenght(string unit);

        /// <summary>
        /// 根据单元编号返回单元对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="unit"></param>
        /// <returns></returns>
        T GetSingle<T>(string unit) where T : class, IB_Unit;

       
       // string GetUnit(double start, double end, string dir, string rdid);

        //double GetMP(string inspecid, string rdwayid, int d);
        //double GetMinBeginMP(string inspecid, string rdwayid, int d);
        //double GetMaxEndMP(string inspecid, string rdwayid, int d);

        /// <summary>
        /// 获取路段下的所有单元
        /// </summary>
        /// <param name="rdwayid"></param>
        /// <returns></returns>
        List<string> List(string rdwayid);

        /// <summary>
        /// 根据路线和方向查询指定单元
        /// </summary>
        /// <param name="dir">方向</param>
        /// <param name="rdid">路线编号</param>
        /// <returns></returns>
        List<T> GetUnitList<T>(string dir, string rdid) where T : class,IB_Unit;

        /// <summary>
        /// 根据路段编号查询单元和评定数据
        /// </summary>
        /// <param name="ldID"></param>
        /// <returns></returns>
        DataTable GetUnitZB(string ldID);

        /// <summary>
        /// 根据路线编号查询单元和评定数据
        /// </summary>
        /// <param name="rdid">路线编号</param>
        /// <returns></returns>
        DataTable GetUnitZBByRdid(string rdid,int dir);

        /// <summary>
        /// 根据养护路段编号返回该路段的平均指标
        /// </summary>
        /// <param name="segId">养护路段编号</param>
        /// <returns></returns>
        DataRow GetUnitAvgZB(string segId);

    }
}
